package model.metrics
{
	import visualization.IDataPoint;
	
	public class Maximum extends Metric
	{
		public function Maximum()
		{
			super();
		}
		
		private var _max:Object;
		override public function startMetric(arr:Array):void{
			if(arr.length != 0){
				this._max = (arr[0] as IDataPoint).getData(this.field);
			}
		}
		
		override public function iterate(item:IDataPoint):void{
			var value:Object = item.getData(this.field);
			if(this._max < value){
				this._max = value;
			}
		}
		
		override public function finishMetric(arr:Array):Object{
			return this._max;
		}
	}
}